package java68_6;

public class Driver {
    private String name;//姓名
    private int age;
    public Driver(String n){
        name=n;
    }
    public Driver(String n,int a){
        this(n);
        //Driver(n);

        //name=n;
        age=a;
    }

    //语法没有问题
//    public int Driver(String n){
//        System.out.println(">>>>>"+n);
//        return 10;
//    }
    public void drive(Car c){
        System.out.println(name+"开着小轿车");
        c.goAndLang();
    }
    public void drive(Bus b){
        System.out.println(name+"开着公交车"+b.getLineno());
        b.run();
    }
    public void drive(Train t){
        System.out.println(name+"开着火车");
        t.landoff();
    }
}
